{% extends 'blog_base.html' %}
{% load staticfiles %}

{% block content %}
<div class="container">
  <div class="row">
    <div class="col-md-8">
      {% for o in object_list %}
      <div class="article-item">
        <div class="article-info">
          <h3>{{ o.title_zh }}</h3>
          <p>阅读次数：{{ o.views }}，作者：{{ o.author }}，发布时间：{{ o.created|date:"Y/n/j" }}，文章标签：{{ o.tags }}</p>
        </div>
        <div class="summary">
          {% autoescape off %}

          <a href="{% url 'article_detail' o.title_slug %}">{{ o.title_slug }}</a>
              <p>{{ o.content_html|truncatechars_html:100 }}</p>
          {% endautoescape %}
        </div>
      </div>
      {% endfor %}
      <nav>
        <ul class="pager">
          <li class="current">{{ object_list.number  }} / {{ object_list.paginator.num_pages  }}</li>
          {% if object_list.has_previous %}
          <li class="previous"><a href="?page={{ object_list.previous_page_number  }}"><span aria-hidden="true">&larr;</span> 上一页</a></li>
          {% else %}
          <li class="previous disabled"><a href=""><span aria-hidden="true">&larr;</span> 上一页</a></li>
          {% endif %}
          {% if object_list.has_next %}
          <li class="next"><a href="?page={{ object_list.next_page_number  }}">下一页 <span aria-hidden="true">&rarr;</span></a></li>
          {% else %}
          <li class="next disabled"><a href="">下一页 <span aria-hidden="true">&rarr;</span></a></li>
          {% endif %}
        </ul>
      </nav>
    </div>
    <div class="col-md-4">
    </div>
  </div>
</div>
{% endblock %}